﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Organize.ascx.cs" Inherits="Admin_Hurman_Controls_Organize" %>
<h2>
    Tổ Chức Phòng Ban</h2>
<div class="func">
    <ul>
        <li class="refresh"><a href="<%= Request.RawUrl %>">Đọc dữ liệu</a></li>
        <li class="add"><span box="add">Thêm & Sửa</span></li>
    </ul>
    <div style="clear: both">
    </div>
</div>
<div>
    <div class="add">
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="valid-erorr" />
        <asp:CustomValidator ID="valid" runat="server" ErrorMessage="" Display="None" 
            onservervalidate="valid_ServerValidate"></asp:CustomValidator>
        <table width="100%">
            <tr>
                <td width="120px">
                    <b>Chi nhánh</b>
                </td>
                <td>
                    <asp:DropDownList ID="ddlBranch" runat="server" AppendDataBoundItems="true" Width="250px">
                        <asp:ListItem Value="">Chọn chi nhánh</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlBranch"
                        Display="Dynamic" ErrorMessage="Chọn chi nhánh">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <b>Phòng ban</b>
                </td>
                <td>
                    <asp:DropDownList ID="ddlDepart" runat="server" AppendDataBoundItems="true" Width="250px">
                        <asp:ListItem Value="">Chọn phòng ban</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddlDepart"
                        Display="Dynamic" ErrorMessage="Chọn phòng ban">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <b>Chức vụ</b>
                </td>
                <td>
                    <asp:DropDownList ID="ddlJob" runat="server" AppendDataBoundItems="true" Width="250px">
                        <asp:ListItem Value="">Chọn chức vụ</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddlJob"
                        Display="Dynamic" ErrorMessage="Chọn chức vụ">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <b></b>
                </td>
                <td>
                    <span class="button">
                        <asp:Button ID="btnAdd" runat="server" Text="Thêm" OnClick="btnAdd_Click" />
                        <span></span></span><span class="button">
                            <asp:Button ID="btnEdit" runat="server" Text="Cập nhật" Visible="false" OnClick="btnEdit_Click" />
                            <span></span></span><span class="button">
                                <asp:Button ID="btnCancel" runat="server" Text="Quay ra" ValidationGroup="cancel"
                                    OnClick="btnCancel_Click" />
                                <span></span></span>
                </td>
            </tr>
        </table>
    </div>
</div>
<table class="grid alter">
    <tr>
        <th width="40px">
        </th>
        <th width="150px">
            Chi nhánh
        </th>
        <th width="150px">
            Phòng ban
        </th>
        <th>
            Chức vụ
        </th>
        <th width="45px">
        </th>
        <th width="45px">
        </th>
    </tr>
    <asp:Repeater ID="rep" runat="server" OnItemCommand="rep_ItemCommand">
        <ItemTemplate>
            <tr>
                <td align="center">
                    <%# Container.ItemIndex + 1 %>
                </td>
                <td>
                    <%# Eval("BranchName") %>
                </td>
                <td>
                    <%# Eval("DepartName") %>
                </td>
                <td>
                    <%# Eval("JobName") %>
                </td>
                <td align="center">
                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="edit" CommandArgument='<%# Eval("Id") %>'
                        ValidationGroup="edit"><img src="/images/button/edit.png" /></asp:LinkButton>
                </td>
                <td align="center">
                    <asp:LinkButton ID="del" runat="server" CommandName="del" CommandArgument='<%# Eval("Id") %>'
                        ValidationGroup="del"><img src="/images/button/delete.png" /></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
</table>

<script type="text/javascript">
    $(document).ready(function(){
        $(".func").fmenu("grid");
    });
</script>

